{% extends "approval/base.html" %}
{% block title %} 项目详情 {% endblock %}
{% block content %}
    <style>
        ul.errorlist li {
            color: red;
        }
    </style>
    <div class="col-lg-6 col-lg-offset-3">
        <section class="panel panel-default">
            <div class="panel-heading">
                项目详情
                {% if form.errors %}
                    <div style="color:red">
                        {{ form.errors }}
                        您提交的数据有误,请认真检查!
                    </div>
                {% endif %}
            </div>
            <div class="panel-body" style="padding: 10px;">
                <form class="form-horizontal">
                    {% csrf_token %}
                    <input type="hidden" name="updated_by" id="id_updated_by" value="{{ request.user.id }}">

                    <div class="form-group">
                        <div class="col-lg-3 col-md-3 col-xs-4">项目编号：</div>
                        <div class="col-lg-9 col-md-9 col-xs-8"> {{ object.code }} </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-3 col-md-3 col-xs-4">项目名称：</div>
                        <div class="col-lg-9 col-md-9 col-xs-8"> {{ object.name }} </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-3 col-md-3 col-xs-4">项目状态：</div>
                        <div class="col-lg-9 col-md-9 col-xs-8"> {{ object.get_status_display }} </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-3 col-md-3 col-xs-4">项目周期：</div>
                        <div class="col-lg-9 col-md-9 col-xs-8"> 开始：{{ object.date_start }} 截止：{{ object.date_finish }}</div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-3 col-md-3 col-xs-4">项目描述：</div>
                        <div class="col-lg-9 col-md-9 col-xs-8"> {{ object.desc }} </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-12 col-md-12 col-xs-12" align="right">
                            {% if perms.approval.change_project %}<a href="{% url 'approval:project_change' object.pk %}"><span type="submit" class="btn btn-primary">编辑</span></a>{% endif %}
                            <a href="{% url 'approval:projects' %}"><span class="btn btn-danger">返回</span></a>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
{% endblock %}
